﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Himall.Entity.Config
{
   public class ShoppingCartItemInfoConfig : EntityTypeConfiguration<ShoppingCartItemInfo>
    {
        public ShoppingCartItemInfoConfig()
        {
            ToTable("Himall_ShoppingCarts");           
            Property(item => item.SkuId).HasColumnType("varchar").HasMaxLength(100);
            HasRequired(x => x.MemberInfo).WithMany(x => x.ShoppingCartInfo).HasForeignKey(x => x.UserId);
            HasRequired(x => x.ProductInfo).WithMany(x => x.Himall_ShoppingCarts).HasForeignKey(x => x.ProductId);
        }
    }
}
